home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 2.2 KB | 47 lines | [TEXT/GEOL] |
- Item 0687081 11-Jan-91 10:41PST
-
- From: BJERKE.M Bjerke, Mark
-
- To: D3554 Discovery SW Int'l, Rick Ross,PRT
- CPLUS.DEV$ C++ Interest List--Developers
- CPLUS.APPLE$ C++ Interest List--Apple Employees
-
- Item forwarded by PERRY.G to CATHERS
- PHIL.TH
-
- Item forwarded by UK.DTS to HYPERVIEW
-
- ------------------------------------------------------------------------------
-
- Sub: HandleObject Derivations
-
- To whom it may concern,
- O.K. as we all know MPW C++ has a built in type 'HandleObject' that was
- designed to simplify the use of handle based objects, i.e. you use them exactly
- as you would a ptr based object ( no need to dereference the handle twice for a
- method call etc..). Normally 'operator new' does ptr based allocation so it was
- overloaded in 'class HandleObject' to do handle based allocation. Since we do
- not publish the interface for 'class HandleObject' we could not expect users to
- know that they needed access to the public interface of 'HandleObject' to
- access 'operator new', so the compiler did not enforce the access rules in the
- case of 'class HandleObject' ONLY. The problem is that this is broken in load /
- dump in the case of doing a PRIVATE derivation from HandleObject. In that case
- we do enforce the rules and complain that 'operator new' is not now accessible
- owing to the fact that the public interface of 'HandleObject' is now private.
- THIS IS A BUG, and we will fix it, the way to get around it is to do a PUBLIC
- derivation. I'm going to make sure the examples are changed since this is not
- very friendly to new users of C++. The compiler does issue a warning which
- should be taken seriously:
- '# warning: base foobar private by default: please be explicit ``: private
- foobar'
-
- i.e. the compiler suspects that the user may be doing a 'private derivation' by
- accident not knowing the implications to the derived class. I suspect that use
- of the keyword 'private' will be mandatory in C++ in the future.
-
- Please report any bugs via apple link: CPLUS.BUGS
-
- regards
- mark bjerke -- C++ Team
-
-